#include "../common.h"

class CHelloSpduiWnd : public WindowImplBase
{
public:
    CHelloSpduiWnd(void){}
    ~CHelloSpduiWnd(void){}
protected:
    virtual CDuiString GetSkinFolder() { return _T ("skin"); }
    virtual CDuiString GetSkinFile()  { return _T ("HelloDuiWnd.xml"); }
    virtual LPCTSTR GetWindowClassName(void) const { return _T ("HelloDuiWnd"); }
    virtual LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled){
	    PostQuitMessage(0);
	    return 0;
    }
};

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
    CPaintManagerUI::SetInstance(hInstance);
    CPaintManagerUI::SetResourcePath(CPaintManagerUI::GetInstancePath() + _T("skin/hello"));

    CHelloSpduiWnd* wnd = new CHelloSpduiWnd;
    wnd->Create(NULL, NULL, UI_WNDSTYLE_DIALOG, 0);
    wnd->CenterWindow();
    wnd->ShowWindow();
    CPaintManagerUI::MessageLoop();

    delete wnd;

    return 0;
}